package com.gotloop.jdo;

import java.io.Serializable;
import java.util.Date;

import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

import com.gotloop.jdo.key.FollowPK;

/**
 * A Following represents an User following another User.
 * @author jibhaine
 *
 */
@PersistenceCapable(objectIdClass = FollowPK.class)
public class Following implements Serializable {

	/**
	 * Generated serial version UID.
	 */
	private static final long serialVersionUID = -5116390531432945249L;

	/**
	 * UserA (following UserB).
	 */
    @Persistent
    @PrimaryKey
	private UserProfile follower;

	/**
	 * UserB (followed by UserA).
	 */
    @Persistent
    @PrimaryKey
	private UserProfile followed;
	
	/**
	 * Date of creation.
	 */
    @Persistent
	private Date creationDate;

	/**
	 * Date of modification.
	 */
    @Persistent
	private Date modificationDate;
	
	/**
	 * True if followed User has blocked this relationship.
	 */
    @Persistent
	private boolean blockedByFollowed;

	/**
	 * Get accessor for follower.
	 * @return the follower to get
	 */
	public UserProfile getFollower() {
		return follower;
	}

	/**
	 * Set accessor for follower.
	 * @param pFollower the follower to set
	 */
	public void setFollower(UserProfile pFollower) {
		this.follower = pFollower;
	}

	/**
	 * Get accessor for followed.
	 * @return the followed to get
	 */
	public UserProfile getFollowed() {
		return followed;
	}

	/**
	 * Set accessor for followed.
	 * @param pFollowed the followed to set
	 */
	public void setFollowed(UserProfile pFollowed) {
		this.followed = pFollowed;
	}

	/**
	 * Get accessor for creationDate.
	 * @return the creationDate to get
	 */
	public Date getCreationDate() {
		return creationDate;
	}

	/**
	 * Set accessor for creationDate.
	 * @param pCreationDate the creationDate to set
	 */
	public void setCreationDate(Date pCreationDate) {
		this.creationDate = pCreationDate;
	}

	/**
	 * Get accessor for modificationDate.
	 * @return the modificationDate to get
	 */
	public Date getModificationDate() {
		return modificationDate;
	}

	/**
	 * Set accessor for modificationDate.
	 * @param pModificationDate the modificationDate to set
	 */
	public void setModificationDate(Date pModificationDate) {
		this.modificationDate = pModificationDate;
	}

	/**
	 * Get accessor for blockedByFollowed.
	 * @return the blockedByFollowed to get
	 */
	public boolean isBlockedByFollowed() {
		return blockedByFollowed;
	}

	/**
	 * Set accessor for blockedByFollowed.
	 * @param pBlocked the blockedByFollowed to set
	 */
	public void setBlockedByFollowed(boolean pBlocked) {
		this.blockedByFollowed = pBlocked;
	}
	
}
